# -*- coding: utf-8 -*-
"""
@author: wyb
@date: 2023/12/19
@time: 20:15
@desc: 641 652
"""
import pyautogui, time

nameField = (515, 267)

formData = [
    {'name': 'Alice', 'fear': 'eavesdroppers', 'source': 'wand', 'comments': 'Tell Bob I said hi.'},
    {'name': 'Bob', 'fear': 'bees', 'source': 'amulet', 'comments': 'my girlcrystal ball'},
    {'name': 'Carol', 'fear': 'puppets', 'source': 'crystal ball',
     'comments': 'Please take the puppets out of the break room.'},
    {'name': 'Alex Murphy', 'fear': 'ED-209', 'source': 'money',
     'comments': 'Protect the innocent. Serve the public trust. Uphold the law.'},
]

pyautogui.PAUSE = 1
print('>>> 5 second pause to let user press ctrl-c <<<')
time.sleep(5)
for person in formData:
    # give the user a chance to kill the script
    pyautogui.click(nameField[0], nameField[1])
    pyautogui.typewrite(person['name'])
    pyautogui.press('enter')
    pyautogui.typewrite(person['fear'])
    pyautogui.press('enter')
    pyautogui.typewrite(person['source'])
    pyautogui.press('enter')
    pyautogui.typewrite(person['comments'])
    pyautogui.press('enter')
    pyautogui.press('esc')
